package com.linxchong.security.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author:linchong
 * @CreateTime:2020-07-15 10:05
 * @Description:审计日志
 */
@Slf4j
@Component
public class AuditLogFilter extends ZuulFilter {
	@Override
	public String filterType() {
		return "pre";
	}

	@Override
	public int filterOrder() {
		return 2;
	}

	@Override
	public boolean shouldFilter() {
		return true;
	}

	@Override
	public Object run() throws ZuulException {
		log.info("根据业务逻辑插入一条日志...");
		return null;
	}
}
